using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;

namespace WebDavSyncTool
{
    [RunInstaller(true)]
    public partial class ProjectInstaller : System.Configuration.Install.Installer
    {
        private ServiceProcessInstaller serviceProcessInstaller;
        private ServiceInstaller serviceInstaller;

        public ProjectInstaller()
        {
            InitializeComponent();

            serviceProcessInstaller = new ServiceProcessInstaller();
            serviceInstaller = new ServiceInstaller();

            // 服务运行账号
            serviceProcessInstaller.Account = ServiceAccount.LocalSystem;

            // 服务设置
            serviceInstaller.ServiceName = "WebDavSyncService";
            serviceInstaller.DisplayName = "WebDAV Sync Service";
            serviceInstaller.Description = "同步本地目录到WebDAV服务器";
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            Installers.Add(serviceProcessInstaller);
            Installers.Add(serviceInstaller);
        }
    }
} 